package C6.E1;

import java.util.LinkedList;

public class E2 {
    public static void main(String[] args) {
        LinkedList link = new LinkedList();
        link.add("张三");
        link.add("李四");
        link.add("王五");
        link.add("赵六");
        link.add(Math.PI);
        //查看link长度
        System.out.println("集合长度："+ link.size());
        System.out.println(link);
        //查看指定位置元素
        System.out.println("第2个元素是：" + link.get(1));
        //修改指定元素
        link.set(2,"王小明");
        System.out.println(link);
        link.add(2,"隔壁老王");
        System.out.println(link);
        link.remove(5);
        System.out.println(link);
    }
}
